<!DOCTYPE html>
<html lang="en" style="background:#fff;">
<head>
	<base href="${basePath}">
	<#include "common/top.html"/>
	<link type="text/css" rel="stylesheet" href="${basePath}plugins/zTree/3.5.1/zTreeStyle/zTreeStyle.css"/>
	<script type="text/javascript" src="${basePath}plugins/zTree/3.5.1/jquery.ztree.core.js"></script>
	<script type="text/javascript" src="${basePath}plugins/zTree/3.5.1/jquery.ztree.excheck.js"></script>
</head>
<body style="background:#fff;">
<form class="layui-form" modelAttribute="dict" name="form1" id="form1"  method="post">
	<input type="hidden" id="dictId" name="dictId" value="${sysDict.dictId}">
	<div class="layui-form-item-dept">
		<div class="layui-form-item">
			<label class="layui-form-label">类型名称：</label>
			<div class="layui-input-inline">
				<input class="layui-input" type="text" name="typeName" id="typeName" placeholder="这里输入类型名称" value="${sysDict.typeName}"  title="类型名称"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">参数名称：</label>
			<div class="layui-input-inline">
				<input class="layui-input" type="text" name="codeName" id="codeName" placeholder="这里输入参数名称" value="${sysDict.codeName}"  title="参数名称"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">参数：</label>
			<div class="layui-input-inline">
				<input class="layui-input" type="text" name="code" id="code" placeholder="这里输入参数" value="${sysDict.code}"  title="参数"/>
			</div>
            <div class="layui-form-item"  >
                <span style="color: red;">注：参数不能重复，否则会添加失败！</span>
            </div>
		</div>
	</div>
</form>
</body>
<script type="text/javascript">
	function save(){
		if(checkIsNull("typeName","请输入类型名称！")){
			return;
		}
		if(checkIsNull("codeName","请输入参数名称！")){
			return;
		}
		if(checkIsNull("code","请输入参数！")){
			return;
		}
		$.ajax({
			url: '${basePath}sysuser/dict/saveUpdateDict',
			data: $("#form1").serialize(),
			type: "POST",
			success: function(data){
				if (data.status == 'success') {
					parent.layer.alert(data.msg,function(index){
						var index1 = parent.layer.getFrameIndex(window.name); //获取窗口索引
						parent.layer.close(index1);
						parent.layer.close(index);
					});
				}else{
					parent.layer.alert(data.msg);
				}
			}
		});
	}
</script>
</body>
</html>